import * as express from 'express'
import Collection from '../models/Collection'

const router = express.Router()

router.get('/:id([0-9a-fA-F]{24})', (req, res, next) => {
  Collection.get({ id: req.params.id })
    .then(c => res.json(JSON.parse(c.content)))
    .catch(next)
})

export default router
